<?php
	
	if(isset($_GET['pid']))
	{
    	$pid = intval($_GET['pid']);
    	if($pid<=0)
    	{
    		edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
    	}
	}
	else
	{
		edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
	}
    
    /**********************************************************
     *	$sid is used for the add_review page
     *  $product_page is used to indicate that this page is
     *  for product instead of shop in the add_reveiw 
     *	Seal created 2009-12-14
     **********************************************************/
    $sid = NULL;
    $product_page = 1;
    
    /*
	if(!isset($pid)||!is_numeric($pid)) {
		echo 'can not find the the pid';
		die();
	}
	*/
		
	$productDAO=GetProductDAO();
	$productInfo=$productDAO->GetProductInfo2($pid);
	   
	if(!$productInfo)
	{
		edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
		
	}
	else
	{   
		$shopDAO=GetShopDAO();	
		$productcategoryDAO=GetProductCategoryDAO();
		$cityDAO=GetCityDAO();
		$userDAO=GetUserDAO();
		$listDAO=GetListDAO();
		 
		//更新view_count字段
		$productDAO->UpdateProductViewCount($pid);
		$userip = getUserRealIPAddr();
		$productDAO->UpdateProductViewHistory($userip,$pid);
	} 
	
?>